import { stringify } from 'querystring';
import request from '@/utils/request';
import { DEFAULT_URL_SHIFT } from '@/constants';

export async function queryData(query, body) {
    return request(`${DEFAULT_URL_SHIFT}/list?${stringify(query)}`, { method: 'POST', body });
}

export async function saveData(option) {
    return request(`${DEFAULT_URL_SHIFT}/insert`, option);
}

export async function updateData(option) {
    return request(`${DEFAULT_URL_SHIFT}/update`, option);
}

export async function deleteData(option) {
    return request(`${DEFAULT_URL_SHIFT}/remove`, option);
}